package com.huawei.statistics.utils;

import com.huawei.statistics.redis.impl.common.RedisTemplate;

/**
 * Created by ywx on 2017/4/30.
 */
public class RedisTokenUtil {


    /**
     *
     * 验证token是否有限
     * 有效则再次保存
     * @param token
     * @return
     */
    public static Boolean isTokenOver(String token){

        RedisTemplate redisTemplate = new RedisTemplate();
        String adminToken = redisTemplate.get("adminToken_adminId"+token);
        if(adminToken != token){

            return false;
        }else{
            redisTemplate.setex("adminToken_adminId"+adminToken,30*60,adminToken);
            return true;
        }



    }








}
